import { request } from "@/utils/request.js";

export const personalFile = (id) => {
  return request({
    url: `/mediafile/list/${id}`,
    method: 'post',
  })
}

export const removeFile = (id) => {
  return request({
    url: `/mediafile/${id}`,
    method: 'delete',
  })
}

export const changeFileStatus = (id, status) => {
  return request({
    url: `/mediafile/${id}/${status}`,
    method: 'post',
  })
}

export const viewDetails = (id) => {
  return request({
    url: `/mediafile/onlinePreview/${id}`,
    method: 'get',
  })
}

export const viewImgDetails = (id) => {
  return request({
    url: `/mediafile/onlinePreview/${id}`,
    method: 'get',
    responseType: 'arraybuffer'
  })
}
